package org.example.Day4.paixu;

import java.util.Arrays;

public class xuanze {
    public static void main(String[] args){
        int[] arr= {5,1,3,2};
        for(int i=0;i<arr.length-1;i++){
            for(int j = i+1;j<arr.length;j++){
                if(arr[i]>arr[j]){
                    //判断后者是否大于前者，大于则放后
                    int temp = arr[i];
                    arr[i] = arr[j];
                    arr[i] =temp;
                }
            }
        }
        System.out.println(Arrays.toString(arr));
    }
}
